Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat<Compiler>: consider that the dispatch function from useReducer is non-reactive #29705

Conversation

TrickyPi
Copy link
Contributor

@TrickyPi TrickyPi commented Jun 1, 2024

Summary

The dispatch function from useReducer is stable, so it is also non-reactive.

the related PR: #29665
the related comment: #29674 (comment)

I am not sure if the location of the new test file is appropriate😅.

How did you test this change?

Added the specific test compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useReducer-returned-dispatcher-is-non-reactive.expect.md.

Copy link

vercel bot commented Jun 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 2:34am

@TrickyPi TrickyPi changed the title feat<Compiler>: Consider dispatch from useReducer is non-reactive feat<Compiler>: the dispatch function from useReducer is non-reactive Jun 1, 2024
@TrickyPi TrickyPi changed the title feat<Compiler>: the dispatch function from useReducer is non-reactive feat<Compiler>: consider that the dispatch function from useReducer is non-reactive Jun 1, 2024
@react-sizebot
Copy link

react-sizebot commented Jun 1, 2024

Comparing: d77dd31...8353f1f

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.66 kB 6.66 kB +0.05% 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 496.48 kB 496.48 kB = 88.87 kB 88.87 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 501.30 kB 501.30 kB = 89.56 kB 89.56 kB
facebook-www/ReactDOM-prod.classic.js = 593.97 kB 593.97 kB = 104.48 kB 104.49 kB
facebook-www/ReactDOM-prod.modern.js = 570.35 kB 570.35 kB = 100.89 kB 100.89 kB
test_utils/ReactAllWarnings.js Deleted 63.65 kB 0.00 kB Deleted 15.90 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 63.65 kB 0.00 kB Deleted 15.90 kB 0.00 kB

Generated by 🚫 dangerJS against 8353f1f

Copy link
Contributor

@josephsavona josephsavona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting, thanks for putting up a PR! Just some quick feedback, will do a full review next week

@TrickyPi
Copy link
Contributor Author

TrickyPi commented Jun 2, 2024

Thanks for your review! The required changes have been made.

Copy link
Contributor

@josephsavona josephsavona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, thanks!

Copy link
Contributor

@josephsavona josephsavona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you need to run prettier

@TrickyPi
Copy link
Contributor Author

TrickyPi commented Jun 4, 2024

Oh, I forgot. Now it's fixed.

@TrickyPi TrickyPi force-pushed the xiaopi/useSelector-dispatcher-non-reactive branch from 610cde5 to 8353f1f Compare June 4, 2024 02:31
@josephsavona josephsavona merged commit 704aeed into facebook:main Jun 5, 2024
51 checks passed
@josephsavona
Copy link
Contributor

Awesome, thanks!

github-actions bot pushed a commit that referenced this pull request Jun 5, 2024
… is non-reactive (#29705)

Summary
The dispatch function from useReducer is stable, so it is also non-reactive.

the related PR: #29665
the related comment: #29674 (comment)

I am not sure if the location of the new test file is appropriate😅.

How did you test this change?
Added the specific test compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useReducer-returned-dispatcher-is-non-reactive.expect.md.

DiffTrain build for commit 704aeed.
@TrickyPi TrickyPi deleted the xiaopi/useSelector-dispatcher-non-reactive branch June 6, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants